﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class InventoryTracker_SIUD : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Add")
        {
            string strItemName = ((TextBox)
            GridView1.FooterRow.FindControl("txtItName")).Text;

            string strItemDescription =
            ((TextBox)GridView1.FooterRow.FindControl
                                  ("txtItDescription")).Text;

            int Tax =
            int.Parse(((TextBox)GridView1.FooterRow.FindControl
                                     ("txtTxa")).Text);
            
            //SqlDataSource1.InsertParameters.Clear();
            //SqlDataSource1.InsertParameters.Add
            //("FirstName", strFirstName);
            //SqlDataSource1.InsertParameters.Add
            //("LastName", strLastName);
            //SqlDataSource1.InsertParameters.Add
            //("Department", strDepartment);
            //SqlDataSource1.InsertParameters.Add
            //("Location", strLocation);

            //SqlDataSource1.InsertParameters["FirstName"].DefaultValue= strFirstName;

            SqlDSSIUD.InsertParameters["ItemName"].DefaultValue = strItemName;
            SqlDSSIUD.InsertParameters["ItemDescription"].DefaultValue
                                                       = strItemDescription;
            SqlDSSIUD.InsertParameters["Tax"].DefaultValue
                                                       = Tax.ToString();
            
            SqlDSSIUD.Insert();
        }
    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowDeleted(object sender, GridViewDeletedEventArgs e)
    {

    }
    protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
    {

    }
}
